﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;
using LCARSLibrary;
using Cepheus;

namespace LCARS_Interface
{
    public class Activity : IPagingIDBasedData
    {
        public int ID { get; set; }
        public string Name { get; set; }

        public class Program : IPagingIDBasedData
        {
            public int ID { get; set; }
            public string Name { get; set; }
            public string Path { get; set; }
        }

        public List<Program> Programs { get; set; }
    }

    [Serializable]
    public class MISettings : ISettingsData
    {
        public string MusicPath = string.Empty;
        public string PicturePath = string.Empty;
        public string DocumentsPath = string.Empty;
        public string VLCPath = string.Empty;
        public string BaseCommand = "Computer";

        public List<Activity> Activites = new List<Activity>();


        //public void LoadDefaults()
        //{
        //    MusicPath = string.Empty;
        //    PicturePath = string.Empty;
        //    DocumentsPath = string.Empty;
        //    VLCPath = string.Empty;

        //    Activites = new List<Activity>(new[]
        //    { 
        //        new Activity()
        //        {   
        //            ID = 0,
        //            Name = String.Empty, 
        //            Programs = new List<Activity.Program>(new[] 
        //            { 
        //                new Activity.Program()
        //                {   
        //                    ID = 0,
        //                    Name = String.Empty, 
        //                    Path = String.Empty
        //                } 
        //            })
        //        }
        //    });
        //}

        public void LoadComplete()
        {
            if (Activites == null || Activites.Count == 0)
            {
                Activites = new List<Activity>(new[]
                { 
                    new Activity()
                    {   
                        ID = 0,
                        Name = String.Empty, 
                        Programs = new List<Activity.Program>(new[] 
                        { 
                            new Activity.Program()
                            {   
                                ID = 0,
                                Name = String.Empty, 
                                Path = String.Empty
                            } 
                        })
                    }
                });
            }
        }
    }
}
